<%@ page language="java" contentType="text/html; charset=UTF-8"
         isELIgnored="false" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib uri="/mytag" prefix="yjd"%>
<body>
<div class="wrap">
    <div class="h_a">搜索</div>
    <form action="${requestScope.FPWEB.rootPath }/pfClearDay/list${requestScope.FPWEB.urlStuff}"  class="J_ajaxForm" method="get" autocomplete="off" id="serchFrom">
        <div class="search_type cc">
            <label>结算日期：</label>
            <input name="cleardate1" type="text" class="input length_1 mr10 J_date" value="${param.cleardate1}">至
            <input name="cleardate2" type="text" class="input length_1 mr10 J_date" value="${param.cleardate2}">
            <button type="submit" class="btn btn_submit length_1">搜索</button>
            <button class="btn length_2 J_ajax_submit_btn" id="generateBtn">生成结算单</button>
        </div>
    </form>
    <div class="table_list">
        <table width="100%">
            <thead>
            <tr>
                <td>结算日期</td>
                <td>支出金额</td>
                <td>收入金额</td>
                <td>交易总金额</td>
                <td>订单笔数</td>
                <td>退单笔数</td>
                <td>结算状态</td>
                <td>生成时间</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody id="J_word_list">
            <c:forEach items="${pager.pagerModel.dataList }" var="item" >
                <tr>
                    <td>${item.clear_date}</td>
                    <td>${item.borrow_price}</td>
                    <td>${item.loan_price}</td>
                    <td>${item.trade_price}</td>
                    <td>${item.trade_count}</td>
                    <td>${item.refund_count}</td>
                    <td><c:if test="${item.status==0}">待确认</c:if><c:if test="${item.status==1}">已确认</c:if></td>
                    <td>${item.strMap.create_time}</td>
                    <td>
                        <a href="${requestScope.FPWEB.rootPath }/pfClearDay/detail${requestScope.FPWEB.urlStuff}?clearDate=${item.clear_date}" class="btn mr10">查看</a>
                        <c:if test="${item.status==0}">
                            <a class="btn btn_submit J_ajax_del" href="${requestScope.FPWEB.rootPath }/pfClearDay/clear${requestScope.FPWEB.urlStuff}?id=${item.id}" data-msg="确认结算？" >结算</a>
                        </c:if>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <!-- 分页 -->
        <%@ include file="../public/pager/pager.pagination.jsp" %>
    </div>
</div>
<script>
    $("#generateBtn").click(
            function(){
                var url='${requestScope.FPWEB.rootPath}/pfClearDay/generate${requestScope.FPWEB.urlStuff}';
                $("#serchFrom").attr("action",url);
            });
    YJD.use('AppAdminCommon');
</script>
</body>